// 事件管理器

#ifndef ALICE_EVENTS_EVENTS_MANAGER_H_
#define ALICE_EVENTS_EVENTS_MANAGER_H_

#include <SDL.h>

#include "director.h"

namespace alice {

enum Axis {
  HORIZONTAL,
  VERTICAL
};

class EventsManager {
  public:
    static EventsManager* GetInstance() {
      return instance_ = (instance_ == nullptr ? new EventsManager() : instance_);
    }

    void Listen();
    bool IsKeyDown(SDL_Scancode key);
    int GetAxisKey(Axis axis);
  
  private:
    EventsManager() { key_states_ = new Uint8(); }
    ~EventsManager() { delete key_states_; }

    void KeyDown();
    void KeyUp();

  private:
    static EventsManager* instance_;
    SDL_Event event_;
    const Uint8* key_states_; 
};

}

#endif // ALICE_EVENTS_EVENTS_MANAGER_H_